package cn.com.cym.gamezao.entity.authorize;

import cn.com.cym.gamezao.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 角色权限对应表
 */
@ApiModel(description="角色对应权限")
@Table(name="a_role_authorize")
@Entity
@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
public class RoleAuthorize extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 442081771879169087L;


    @ManyToOne
    @JoinColumn(name = "role_id")
    //@JsonIgnore
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Role role;


    @ManyToOne
    @JoinColumn(name = "authorize_id")
    //@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Authorize authorize;
}
